<template>
	<div>
		<u-popup :show="show2" mode="center" @touchmove.stop.prevent="moveHandle">
			<view class="box-tk">
				<view class="view1">请选择生命体征模板</view>
				<view class="xian"></view>
				<view class="box-xis">
					<view class="xis-title" v-for="(item,index) in reportList" :key="index" @tap="jamp(item.modelid,item.mbmc)">
						<text>{{item.mbmc}}</text>
					</view>
				</view>
				<view class="tk-heard">
					<slot name="btn"></slot>
				</view>
			</view>
		</u-popup>
	</div>
</template>

<script>
	import { Ward_Getphysiorcd } from '../../api/user.js'
	import {
		mapMutations,
		mapState
	} from "vuex";
	export default {
		props: {
			show2: {
				type: Boolean,
				default: false
			},
			// reportList:{
			// 	type:Array,
			// 	default: []
			// },
			checkitem: {
				type: String,
				default: ''
			}
		},

		data() {
			return {
				// show2: true
				reportList: []
			}
		},
		computed: {
			...mapState('user', ['userInfo', 'passObj', 'scanningArray', 'deleteObj'])
		},
		created() {
			this.Ward_GetphysiorcdFun()
		},
		methods: {
			cancel() {
				this.$emit('update:show2', false);
				// this.show2 = false
			},
			moveHandle() {},
			jamp(e,name){
				this.$emit('unolyCun', false);
				uni.navigateTo({
					url: '../../pages/information/records?id='+ e +'&' + 'name=' + name
				});
			},
			Ward_GetphysiorcdFun(){
				try{
					// uni.showLoading({
					// 	title: '加载中...', //显示的文字
					// 	// duration: 3000, //显示多少时间，默认1500毫秒
					// 	icon: "loading", //自定义显示的图标，默认成功success，错误error,加载loading，不显示图标是none
					// 	mask: true
					// })
					const user = uni.getStorageSync('userInfo')
					const data = {
						HosKind: user.hoscode,
						sOperdept: user.HosKind,
						sOperJp: user.sPassword
					}
					this.$http.Ward_Getphysiorcd(data).then(res=>{
						res.sort((q, w) => {
							return q.modelid > w.modelid ? 1 : -1;
						})
						this.reportList = res
						// uni.hideLoading();
					})
				}catch(e){
					//TODO handle the exception
				}
			}
		}
	}
</script>


<style scoped lang="scss">
	.box-tk {
		width: 670rpx;
		height: 500px;
		// height: 212rpx;
		// background: #FFFFFF;
		border-radius: 8rpx;
		position: relative;
		padding-bottom: 20rpx;

		.view1 {
			font-size: 36rpx;
			font-family: SourceHanSansCN-Medium, SourceHanSansCN;
			font-weight: 500;
			color: #333333;
			height: 45px;
			// line-height: 45px;
			// text-align: center;
			white-space: break-spaces;
			padding: 0 6px;
			text-overflow: ellipsis;
			overflow: hidden;
			text-align: center;
			line-height: 45px;
		}

		.xian {
			position: absolute;
			width: 100%;
			height: 2rpx;
			background: #7AD9DF;
			left: 0;
			top: 96rpx;
			// opacity: 0.19;
			// opacity: 0.19;
			// margin: 14rpx 0;
		}

		.box-xis {
			width: 95%;
			// height: 262px;
			margin: 20rpx auto 0;
			// padding-bottom: 12rpx;
			position: relative;
			border-radius: 12rpx;
			height: calc(100% - 100px);
			overflow-y: scroll;

			.xis-title {
				background: #B0E9EC;
				box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.1);
				border-radius: 4px;
				padding: 0 20px;
				margin-bottom: 10px;
				position: relative;
				display: flex;
				align-items: center;

				text {
					font-size: 16px;
					font-family: SourceHanSansCN-Normal, SourceHanSansCN;
					font-weight: 400;
					color: #333333;
					line-height: 40px;

				}

				&:last-child {
					margin-bottom: 0;
				}

				&:before {
					content: " ";
					width: 10px;
					height: 10px;
					background: linear-gradient(180deg, #FFC983 0%, #FF984C 100%);
					box-shadow: 0px 0px 2px 0px #CE8956;
					border-radius: 5px;
					margin-right: 10px;

				}

			}
		}

		.tk-heard {
			display: flex;
			// height: calc(100% - 636rpx);
			align-items: center;
			margin: 16rpx auto 0;
			width: 96%;
		}

		.tk-heard ::v-deep {
			.u-button__text {
				font-size: 36rpx !important;
				font-family: SourceHanSansCN-Medium, SourceHanSansCN;
				font-weight: 500;
				color: #FFFFFF;
				line-height: 54rpx;
				letter-spacing: 28rpx;
			}
		}
	}
</style>
